package com.xying.util;

import com.bitsinharmony.recognito.Recognito;

/**
 * 单例，应用场景无需保证线程安全
 * Created by Administrator on 2021/4/22.
 */
public class RecogntioFactory {
    private static Recognito recognito;
    private static final Float DEFAULT_RATE = 48000.0f;

    private RecogntioFactory(){}


    public static Recognito getRecognito(Float sampleRate){
        if (recognito == null){
            recognito = new Recognito(sampleRate);
        }

        return recognito;
    }

    public static Recognito getRecognito(){
        return getRecognito(DEFAULT_RATE);
    }
}
